<template>
  <div>
    <order :showBtn="showBtn" :detaildata='detaildata'></order>

    <div v-if="detaildata?.arrive == 1">
      <div class="title">诊断</div>
      <el-input
        type="textarea"
        :disabled="status == 3 ? true : false"
        :placeholder="txtVal?'请填写诊断信息':txtVal"
        v-model="txtVal"
      >
      </el-input>
    </div>
    <div class="ds-b f-row ai-c mt-1">
      <div class="btn-light " @click="$router.go(-1)">返回</div>
      <div v-if="status != 3 && detaildata?.arrive != 0">
        <div class="btn-deep" @click="save">保存</div>
        <div class="btn-light" @click="completeFn">结束就诊</div>
      </div>
    </div>
  </div>
</template>
<script>
import order from "@/components/common/order.vue";
export default {
  props: {
    showBtn: {
      type: Boolean,
      default: true,
    },
    detaildata: Object,
  },
  components: {
    order,
  },
  data() {
    return {
      txtVal: this.detaildata?.diagnosticContent,
      status:this.detaildata?.status
    };
  },
  methods: {
    /* 病例保存 */
    save(e) {
      this.$emit("saveRegister", this.txtVal);
    },
/* 病例结束 */
    completeFn() {
      this.$emit("completeFn");
    },
  },
};
</script>
<style lang="less" scoped>
.el-textarea {
  margin-top: 0.625rem;
  width: 40.5625rem;
  margin-bottom: 1.25rem;
}
.title {
  color: #1f1f1f;
  font-weight: 600;
  border-left: 0.3125rem solid var(--darkColor);
  padding-left: 0.625rem;
}
</style>